package xyz.xuetu.www.provider;

import xyz.xuetu.www.common.service.UserService;
import xyz.xuetu.www.provider.service.UserServiceImpl;
import xyz.xuetu.www.rpc.bootstrap.ProviderBootstrap;
import xyz.xuetu.www.rpc.model.ServiceRegisterInfo;

import java.util.ArrayList;
import java.util.List;

/**
 * 简单服务提供者示例
 */
public class ProviderExample {

    public static void main(String[] args) {
        // 要注册的服务
        List<ServiceRegisterInfo> serviceRegisterInfoList = new ArrayList<>();
        String serviceName = UserService.class.getName();
        Class<UserServiceImpl> serviceImplClass = UserServiceImpl.class;
        ServiceRegisterInfo serviceRegisterInfo = new ServiceRegisterInfo(serviceName, serviceImplClass);
        serviceRegisterInfoList.add(serviceRegisterInfo);

        // 服务提供者初始化
        ProviderBootstrap.init(serviceRegisterInfoList);
    }
}
